<%@ page language="java" contentType="text/html; charse=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<jsp:include page="../tmp/header2.jsp"/>
<div class="main-content" style="margin-left: 0px;padding-top: 0px;">
					<div class="breadcrumbs" id="breadcrumbs" style="left:0">
						<script type="text/javascript">
							try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
						</script>
						<ul class="breadcrumb">
							<li><i class="icon-home home-icon"></i>主页</li>
							<li>${pname }</li><li>${name }</li>
							<li>
								<a href="${action }.html?pname=${pname }&name=${name}${action == 'add'?'':'&id='}${action == 'add'?'':data.id}">
								<c:if test="${action=='add' }">添加</c:if>
								<c:if test="${action!='add' }">修改</c:if>
								</a>
							</li>
						</ul><!-- .breadcrumb -->

						<div class="nav-search" id="nav-search">
							<form class="form-search">
								<span class="input-icon">
									<input type="text" placeholder="Search ..." class="nav-search-input" id="nav-search-input" autocomplete="off" />
									<i class="icon-search nav-search-icon"></i>
								</span>
							</form>
						</div><!-- #nav-search -->
					</div>
<div class="page-content">
	<div class="row">
		<div style="width: 960px;">
	    	<div style="float:left"><label>标题:&nbsp;</label></div>
	        <div style="float:left"><input id="title" class="input-text" type="text" value="${data.title }" placeholder="标题"></div>
	         <div style="float:left;margin-left:20px;"><input id="test" class="btn btn-primary" type="button" value="载入"></div>
	         <div style="float:left;margin-left:20px;">
					<label>
						<input id="s" name="switch-field-1" class="ace ace-switch ace-switch-7" type="checkbox">
						<span class="lbl"></span>
					</label>
				</div>
				 <div style="float:left;margin-left:20px;"><input id="source" class="btn btn-primary" type="text" readonly value="${data.source }"></div>
	        
	        <div style="float:right;"><input id="apply" class="btn btn-warning" value="发布" ></div>
	    	<div style="float:both "></div>
    	</div>
    	
    	 <script id="editor" type="text/plain" style="width:980px;height:350px;margin-top: 60px;"></script>
    </div>
	
	<div id="tent" style="display:block">
	${data.content }
	</div>
	
</div>
</div><!-- /.main-content -->
<script type="text/javascript" src="/public/static/assets/js/jquery-2.0.3.min.js"></script>
<script type="text/javascript" charset="utf-8" src="/public/static/ueditor/utf8-jsp/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="/public/static/ueditor/utf8-jsp/ueditor.all.min.js"></script>
<script type="text/javascript" charset="utf-8" src="/public/static/ueditor/utf8-jsp/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript">
var ue = UE.getEditor('editor');
$(function(){
	$("#test").click(function(){
		ue.setContent($("#tent").html());
	})
	$("#apply").click(function(){
		var html = ue.getContent();
		//alert(html);
		var title = $("#title").val();
		$.ajax({url:"/admin/WanActive/modify_chk.html",
				data:{title:title,content:html,id:"${data.id}",
					apply:$('#s').is(':checked'),source: $("#source").val()},type:"post",success:function(data){
			if(data != 0){
				//window.location.href="/article/"+data+".html";
				alert("修改成功");
			}
		}});
	});
	
})


</script>
<jsp:include page="../tmp/footer.jsp"/>